package com.demo.test.controller;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.demo.common.entity.User;
import com.demo.common.feign.UserFeign;
import com.demo.common.util.R;
import com.demo.test.entity.ServiceName;
import com.demo.test.service.ServiceNameService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/test")
@Slf4j
public class ServiceNameController {

//    private final UserFeign userFeign;

    @Autowired
    private ServiceNameService serviceNameService;

    private String timeOut;

    @PostMapping("/test1")
    public R test(@RequestBody User user) {
        return new R<>();
    }

    @PostMapping("/saveServiceName")
    public R saveServiceName(){
        serviceNameService.testLcn();
        return new R<>("success");
    }

    @GetMapping("test2")
    public R tes2(){
        return new R<>(timeOut);
    }
}